extends ../layouts/default

block main
  h1= article.title

block content
  .row
    .span9
      p=article.body
      p.author
        span Author :&nbsp;
        a(href="/users/"+article.user._id)=article.user.name
      .date= formatDate(article.createdAt, "%b %d, %Y at %I:%M %p")
      if (article.tags)
        .tags
          | Tags :&nbsp;
          each tag in article.tags.split(',')
            a.tag(href="/tags/"+tag)
              i.icon-tags
              |  #{tag}
    .span3
      if (!article.isNew && article.image && article.image.files && article.image.files.length)
        img(src=article.image.cdnUri + '/mini_' + article.image.files[0])

  p
    br
    form.center.form-inline.confirm(action="/articles/"+article.id, method="post")
      a.btn(href='/articles/'+article._id+'/edit', title="edit") Edit
      &nbsp;&nbsp;
      input(type="hidden", name="_method", value="DELETE")
      button.btn.btn-danger(type="submit") delete

  p
    br
    h2 Comments
    each comment in article.comments
      include ../comments/comment
    include ../comments/form
